import request from '@/utils/request'
import scope from './scope'
const apiPrefix = `${process.env.VUE_APP_BASE_API}/${scope}/xbcmaterrial/`

// 物料管理
export const getMaterrial = (params, config = {}) => {
  return request.get(apiPrefix + 'get', { params: params }, config)
}
export const getXbcmaterrialListPage = (params, config = {}) => {
  params = params || {}
  return request.post(apiPrefix + 'getpage', params, config)
}
export const getAllPage = (params, config = {}) => {
  return request.get(apiPrefix + 'exportAllPage', { params: params }, config)
  // params = params || {}
  // return request.get(apiPrefix + 'getpage', params, config)
}
export const addMaterrial = (params, config = {}) => {
  return request.post(apiPrefix + 'add', params, config)
}
export const editXbcmaterrial = (params, config = {}) => {
  return request.put(apiPrefix + 'update', params, config)
}
export const removeXbcmaterrial = (params, config = {}) => {
  return request.delete(apiPrefix + 'softdelete', { params: params }, config)
}
export const batchRemoveXbcmaterrial = (params, config = {}) => {
  return request.put(apiPrefix + 'BatchsoftDelete', params, config)
}
